package java8_26.chongwu;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class PetTest11 {
    public static void main(String[] args) {
        FlowerAndBirdMarket m=new FlowerAndBirdMarket("玉峰花鸟市场");
        Scanner in=new Scanner(System.in);
        System.out.println("花多少钱买宠物：");
        int money=in.nextInt();
        Pet pet=m.sell(money);
        if(pet==null){
            System.out.println("钱少了，没买到");
            return;
        }

        if(pet instanceof Tiger){
            System.out.println("买了一只老虎");
        }else if(pet instanceof Penguin){
            System.out.println("买了一只企鹅");
        }else if(pet instanceof Dog){
            System.out.println("买了一只狗！");
        }
        pet.print();
    }
}
